package com.hsgene.user.condition;

import com.hsgene.common.util.support.OrderField;

import java.util.stream.Stream;

/**
 * 后台用户列表排序条件
 *
 * @author wangbing
 * @version 1.0, 2018/11/5
 */
public enum OperationAccountOrderField implements OrderField {
    /**
     * 创建时间
     */
    CREATE_DATE_TIME("create_date_time");

    private final String value;

    OperationAccountOrderField(String value) {
        this.value = value;
    }

    public String getValue() {

        return value;
    }

    public static OperationAccountOrderField getInstance() {
        return values()[0];
    }

    @Override
    public Stream<String> getNames() {
        return Stream.of(values()).map(OperationAccountOrderField::getValue);
    }

    @Override
    public boolean check(String fieldName) {
        return OrderField.check(this, fieldName);
    }
}
